package com.sesame;

import com.alibaba.fastjson.annotation.JSONField;
import kim.sesame.common.web.context.SpringContextUtil;
import lombok.Data;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.Date;

@SpringBootApplication
public class WebApp {

    public static void main(String[] args) {
        SpringApplication.run(WebApp.class, args);

//        User user = new User("1", "aa", new Date());
//        user.setTime(null);
//        String json = JSON.toJSONStringWithDateFormat(user, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat);
//        System.out.println(json);

    }

    @Data
    static class User {
        private String id;
        private String name;
        @JSONField(format = "yyyy-MM-dd HH:mm:ss")
        private Date time;

        public User(String id, String name, Date time) {
            this.id = id;
            this.name = name;
            this.time = time;
        }
    }
}
